#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project  : ecshop-gitee
# @File     : page_ecshop_back_uninstall_distribution_mode.py
# @Author   : LiuLei
# @Time     : 2021/7/3 16:17
# 引入方法
from selenium.webdriver.common.by import By
import time


# 创建类
class PageEcshopBackUninstallDistributionMode():

    def __init__(self, driver):
        self.driver = driver
        # 对方法进行赋值
        self.loc_ecshop_uninstall = (By.XPATH, '//div[@id="listDiv"]/table/tbody/tr[2]/td[8]/a[1]')

    def back_ecshop_uninstall(self):
        time.sleep(2)
        # 点击卸载按钮
        self.driver.find_element(*self.loc_ecshop_uninstall).click()
        self.driver.switch_to.alert.accept()

    def back_ecshop_create_oder(self):
        self.back_ecshop_uninstall()
